package com.lq.util;

public class NumberUtil {
	private static long sms_id_incr = 0;

	public final static synchronized Long genSmsID() {
		long s = System.currentTimeMillis();
		s = s / 1000 - 1300000000l;
		StringBuffer seed = new StringBuffer(String.valueOf(s)).append(String.format("%08d", (++sms_id_incr % 1000000)));

		// String seed = String.valueOf(s) + String.format("%08d",
		// (++sms_id_incr % 1000000));
		return Long.parseLong(seed.toString());
	}

	public static void main(String[] args) {
		long time = System.currentTimeMillis();
		Long a = genSmsID();
		System.out.println(a);
		System.out.println(System.currentTimeMillis() - time);
	}
}